3.1 \(\int \frac{\tan ^4(x)}{a+a \cos (x)} \, dx\)

Optimal. Leaf size=33 \[ \frac{\tan ^3(x)}{3 a}+\frac{\tanh ^{-1}(\sin (x))}{2 a}-\frac{\tan (x) \sec (x)}{2 a} \]

[Out]

ArcTanh[Sin[x]]/(2*a) - (Sec[x]*Tan[x])/(2*a) + Tan[x]^3/(3*a)

________________________________________________________________________________________

Rubi [A]  time = 0.0805143, antiderivative size = 33, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.385, Rules used = {2706, 2607, 30, 2611, 3770} \[ \frac{\tan ^3(x)}{3 a}+\frac{\tanh ^{-1}(\sin (x))}{2 a}-\frac{\tan (x) \sec (x)}{2 a} \]

Antiderivative was successfully verified.

[In]

Int[Tan[x]^4/(a + a*Cos[x]),x]

[Out]

ArcTanh[Sin[x]]/(2*a) - (Sec[x]*Tan[x])/(2*a) + Tan[x]^3/(3*a)

Rule 2706

Int[((g_.)*tan[(e_.) + (f_.)*(x_)])^(p_.)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[1/a, Int[S
ec[e + f*x]^2*(g*Tan[e + f*x])^p, x], x] - Dist[1/(b*g), Int[Sec[e + f*x]*(g*Tan[e + f*x])^(p + 1), x], x] /;
FreeQ[{a, b, e, f, g, p}, x] && EqQ[a^2 - b^2, 0] && NeQ[p, -1]

Rule 2607

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2611

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(a*Sec[e
+ f*x])^m*(b*Tan[e + f*x])^(n - 1))/(f*(m + n - 1)), x] - Dist[(b^2*(n - 1))/(m + n - 1), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{\tan ^4(x)}{a+a \cos (x)} \, dx &=-\frac{\int \sec (x) \tan ^2(x) \, dx}{a}+\frac{\int \sec ^2(x) \tan ^2(x) \, dx}{a}\\ &=-\frac{\sec (x) \tan (x)}{2 a}+\frac{\int \sec (x) \, dx}{2 a}+\frac{\operatorname{Subst}\left (\int x^2 \, dx,x,\tan (x)\right )}{a}\\ &=\frac{\tanh ^{-1}(\sin (x))}{2 a}-\frac{\sec (x) \tan (x)}{2 a}+\frac{\tan ^3(x)}{3 a}\\ \end{align*}

Mathematica [B]  time = 0.136571, size = 105, normalized size = 3.18 \[ -\frac{\sec ^3(x) \left (2 (-3 \sin (x)+3 \sin (2 x)+\sin (3 x))+9 \cos (x) \left (\log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right )-\log \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right )\right )+3 \cos (3 x) \left (\log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right )-\log \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right )\right )\right )}{24 a} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[x]^4/(a + a*Cos[x]),x]

[Out]

-(Sec[x]^3*(9*Cos[x]*(Log[Cos[x/2] - Sin[x/2]] - Log[Cos[x/2] + Sin[x/2]]) + 3*Cos[3*x]*(Log[Cos[x/2] - Sin[x/
2]] - Log[Cos[x/2] + Sin[x/2]]) + 2*(-3*Sin[x] + 3*Sin[2*x] + Sin[3*x])))/(24*a)

________________________________________________________________________________________

Maple [B]  time = 0.062, size = 103, normalized size = 3.1 \begin{align*} -{\frac{1}{3\,a} \left ( \tan \left ({\frac{x}{2}} \right ) -1 \right ) ^{-3}}-{\frac{1}{a} \left ( \tan \left ({\frac{x}{2}} \right ) -1 \right ) ^{-2}}-{\frac{1}{2\,a} \left ( \tan \left ({\frac{x}{2}} \right ) -1 \right ) ^{-1}}-{\frac{1}{2\,a}\ln \left ( \tan \left ({\frac{x}{2}} \right ) -1 \right ) }-{\frac{1}{3\,a} \left ( \tan \left ({\frac{x}{2}} \right ) +1 \right ) ^{-3}}+{\frac{1}{a} \left ( \tan \left ({\frac{x}{2}} \right ) +1 \right ) ^{-2}}-{\frac{1}{2\,a} \left ( \tan \left ({\frac{x}{2}} \right ) +1 \right ) ^{-1}}+{\frac{1}{2\,a}\ln \left ( \tan \left ({\frac{x}{2}} \right ) +1 \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)^4/(a+a*cos(x)),x)

[Out]

-1/3/a/(tan(1/2*x)-1)^3-1/a/(tan(1/2*x)-1)^2-1/2/a/(tan(1/2*x)-1)-1/2/a*ln(tan(1/2*x)-1)-1/3/a/(tan(1/2*x)+1)^
3+1/a/(tan(1/2*x)+1)^2-1/2/a/(tan(1/2*x)+1)+1/2/a*ln(tan(1/2*x)+1)

________________________________________________________________________________________

Maxima [B]  time = 1.14816, size = 155, normalized size = 4.7 \begin{align*} -\frac{\frac{3 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac{8 \, \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} - \frac{3 \, \sin \left (x\right )^{5}}{{\left (\cos \left (x\right ) + 1\right )}^{5}}}{3 \,{\left (a - \frac{3 \, a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac{3 \, a \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} - \frac{a \sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}}\right )}} + \frac{\log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right )}{2 \, a} - \frac{\log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right )}{2 \, a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)^4/(a+a*cos(x)),x, algorithm="maxima")

[Out]

-1/3*(3*sin(x)/(cos(x) + 1) - 8*sin(x)^3/(cos(x) + 1)^3 - 3*sin(x)^5/(cos(x) + 1)^5)/(a - 3*a*sin(x)^2/(cos(x)
 + 1)^2 + 3*a*sin(x)^4/(cos(x) + 1)^4 - a*sin(x)^6/(cos(x) + 1)^6) + 1/2*log(sin(x)/(cos(x) + 1) + 1)/a - 1/2*
log(sin(x)/(cos(x) + 1) - 1)/a

________________________________________________________________________________________

Fricas [A]  time = 1.46392, size = 158, normalized size = 4.79 \begin{align*} \frac{3 \, \cos \left (x\right )^{3} \log \left (\sin \left (x\right ) + 1\right ) - 3 \, \cos \left (x\right )^{3} \log \left (-\sin \left (x\right ) + 1\right ) - 2 \,{\left (2 \, \cos \left (x\right )^{2} + 3 \, \cos \left (x\right ) - 2\right )} \sin \left (x\right )}{12 \, a \cos \left (x\right )^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)^4/(a+a*cos(x)),x, algorithm="fricas")

[Out]

1/12*(3*cos(x)^3*log(sin(x) + 1) - 3*cos(x)^3*log(-sin(x) + 1) - 2*(2*cos(x)^2 + 3*cos(x) - 2)*sin(x))/(a*cos(
x)^3)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{\tan ^{4}{\left (x \right )}}{\cos{\left (x \right )} + 1}\, dx}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)**4/(a+a*cos(x)),x)

[Out]

Integral(tan(x)**4/(cos(x) + 1), x)/a

________________________________________________________________________________________

Giac [B]  time = 1.35476, size = 88, normalized size = 2.67 \begin{align*} \frac{\log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) + 1 \right |}\right )}{2 \, a} - \frac{\log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) - 1 \right |}\right )}{2 \, a} - \frac{3 \, \tan \left (\frac{1}{2} \, x\right )^{5} + 8 \, \tan \left (\frac{1}{2} \, x\right )^{3} - 3 \, \tan \left (\frac{1}{2} \, x\right )}{3 \,{\left (\tan \left (\frac{1}{2} \, x\right )^{2} - 1\right )}^{3} a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)^4/(a+a*cos(x)),x, algorithm="giac")

[Out]

1/2*log(abs(tan(1/2*x) + 1))/a - 1/2*log(abs(tan(1/2*x) - 1))/a - 1/3*(3*tan(1/2*x)^5 + 8*tan(1/2*x)^3 - 3*tan
(1/2*x))/((tan(1/2*x)^2 - 1)^3*a)